package cate.game.pvp.throne.data;

import cate.common.table.d.GDThrone;
import cate.game.db.mongo.kv.KvMongo;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
@NoteClass("王座争霸game kv数据")
public class TBGameKV extends KvMongo {

    @NoteField("赛季")
    public int index;

    @NoteField("阶段")
    public byte period;

    @NoteField("淘汰赛基础")
    public TBKoGameBase koBase;

    @Override
    public String getKeyPrefix() {
        return KvMongo.KEY_THRONE_BATTLE_GAME;
    }

    @Override
    public void initialize() {
        if (koBase == null) {
            koBase = new TBKoGameBase();
        }
        koBase.initialize();
    }

    public void clear(){
        period = GDThrone.Period.NULL;
        koBase.clear();
    }
}
